{
Author:  Prof1983 prof1983@yandex.ru
Created: 19.03.2009
LastMod: 24.03.2009
}
unit ModuleManagerWin;

interface

uses
  Controls,
  ABaseIntf, AUI, AUIcl;

type
  TModuleManagerWindow = class
  private
    FMemo: IAUIclMemo;
    FWindow: IAUIWindow;
    FUI: IAUIcl;
  public
    constructor Create(UI: IAUIcl);
    procedure Refresh;
    procedure Show;
  end;

implementation

{ TModuleManagerWindow }

constructor TModuleManagerWindow.Create(UI: IAUIcl);
begin
  FUI := UI;

  FWindow := UI.NewWindow(0);
  FWindow.SetRequestSize(300, 300);

  FMemo := UI.NewMemo();
  FMemo.Align := Integer(alClient);
  FWindow.AddWidget(FMemo);
end;

procedure TModuleManagerWindow.Refresh;
var
  Core: IACore;
  C: Integer;
  I: Integer;
begin
  FMemo.Clear();
  Core := FUI.Core;
  C := Core.ModuleCount;
  for I := 0 to C - 1 do
  begin
    FMemo.AddLine(Core.GetModuleByIndex(I).Name);
  end;
end;

procedure TModuleManagerWindow.Show;
begin
  FWindow.Visible := True;
  Refresh();
end;

end.
